package com.jacobson.core.mvp

import android.app.Activity
import android.os.Bundle


/**
 * ================================================
 *
 * @author Wucz on 2018/7/16 11:37
 * ================================================
 */
interface IView {
    /**
     * 关闭显示对话框
     *
     * @param type 类型
     */
    fun invisibleDialog(type: Int = 0)

    /**
     * 显示对话框
     *
     * @param type 对话框类型
     * @param args 数据
     */
    fun visibleDialog(type: Int = 0, args: Bundle? = null): Boolean

    fun startLoading(type: Int = 0, extra: Any? = 0)

    fun stopLoading(type: Int = 0, extra: Any? = 0)

    /**
     * 重新加载
     */
    fun reload()

    /**
     * 获取Activity
     */
    fun fetchActivity(): Activity?

    /**
     * 未登录状态做需要登录操作，提示去登录
     */
    fun tipToLogin()

    /**
     * 失败
     */
    fun onError(type: Int = 0, extra: Any? = null, code: Int = 0, message: String = ""): Boolean

}